/* 不良品汇总页面样式 */

/* 基础样式重置 */
* {
    box-sizing: border-box;
}

/* 页面容器 */
.defective-summary-container {
    min-height: 100vh;
    background-color: #f5f5f5;
}

/* 查询区域样式 */
.search-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.search-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    font-weight: 500;
}

.search-body {
    padding: 20px;
}

/* 高级查询折叠动画 */
.advanced-search-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.advanced-search-content.show {
    max-height: 1000px;
}

/* 表单控件增强 */
.layui-form-item {
    margin-bottom: 20px;
}

.layui-form-label {
    font-weight: 500;
    color: #333;
}

/* 按钮组样式 */
.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-group .layui-btn {
    min-width: 80px;
}

/* 统计卡片样式 */
.stats-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.stats-header {
    background: #fafafa;
    padding: 15px 20px;
    border-bottom: 1px solid #e6e6e6;
    font-weight: 500;
    color: #333;
}

.stats-body {
    padding: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stats-item {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 8px;
    color: white;
    transition: transform 0.3s ease;
}

.stats-item:hover {
    transform: translateY(-2px);
}

.stats-number {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 8px;
}

.stats-label {
    font-size: 14px;
    opacity: 0.9;
}

/* 表格增强样式 */
.table-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.table-header {
    background: #fafafa;
    padding: 15px 20px;
    border-bottom: 1px solid #e6e6e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-weight: 500;
    color: #333;
}

.table-actions {
    display: flex;
    gap: 10px;
}

.table-container {
    padding: 20px;
    overflow-x: auto;
}

/* 表格样式优化 */
.layui-table {
    border-radius: 0;
    border: 1px solid #e6e6e6;
}

.layui-table thead tr {
    background-color: #f8f9fa;
}

.layui-table thead th {
    font-weight: 600;
    color: #333;
    border-right: 1px solid #e6e6e6;
}

.layui-table tbody tr {
    transition: background-color 0.2s ease;
}

.layui-table tbody tr:hover {
    background-color: #f0f8ff;
}

.layui-table tbody td {
    border-right: 1px solid #f0f0f0;
    color: #666;
}

/* 分页样式 */
.pagination-container {
    padding: 20px;
    text-align: center;
    background: #fafafa;
    border-top: 1px solid #e6e6e6;
}

/* 不良率颜色标识 */
.defective-rate-low {
    color: #4caf50;
    font-weight: 500;
}

.defective-rate-medium {
    color: #ff9800;
    font-weight: 500;
}

.defective-rate-high {
    color: #f44336;
    font-weight: 500;
}

/* 数据为空时的样式 */
.empty-data {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-data i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #ddd;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1E9FFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .layui-fluid {
        padding: 10px;
    }
    
    .search-body {
        padding: 15px;
    }
    
    .table-container {
        padding: 15px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .layui-btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .table-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-number {
        font-size: 24px;
    }
    
    .layui-form-label {
        width: 80px;
    }
    
    .layui-input-block {
        margin-left: 90px;
    }
}

/* 打印样式 */
@media print {
    .search-section,
    .table-actions,
    .pagination-container {
        display: none;
    }
    
    .layui-fluid {
        padding: 0;
    }
    
    .table-section {
        box-shadow: none;
        border: 1px solid #333;
    }
    
    .layui-table {
        border: 1px solid #333;
    }
    
    .layui-table th,
    .layui-table td {
        border: 1px solid #333;
        padding: 8px;
    }
}

/* 工具提示样式 */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

/* 高亮搜索关键词 */
.highlight {
    background-color: #ffeb3b;
    padding: 2px 4px;
    border-radius: 2px;
}

/* 状态标签样式 */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    min-width: 60px;
}

.status-badge.success {
    background-color: #e8f5e8;
    color: #4caf50;
}

.status-badge.warning {
    background-color: #fff3e0;
    color: #ff9800;
}

.status-badge.danger {
    background-color: #ffebee;
    color: #f44336;
} 